package org.jiucai.app.demo;

import java.util.Map;

import org.jiucai.appframework.base.spring.service.IPageService;
import org.jiucai.cas.auth.util.UserUtil;
import org.jiucai.cas.domain.UserInfo;

/**
 * Winner 页面基类
 * 
 * @author zhaidw
 * 
 */
public abstract class DemoBasePageService extends DemoBaseService implements
		IPageService {

	

	/**
	 * 返回拼接了基路径的视图页面路径，方便迁移
	 * 
	 * @return
	 */
	public String getViewPath(String viewName) {
		StringBuffer viewPath = new StringBuffer("");

		viewPath.append("demo/");
		viewPath.append(viewName);

		return viewPath.toString();
	}

	@Override
	public final String handleRequest(Map<String, Object> param,
			Map<String, Object> view) {

		// 页头，页脚动态数据处理实现

		UserInfo authUser = UserUtil.getUser();
		view.put("sessAuthUser", authUser);

		// 子类实现
		return process(param, view);
	}

	

	/**
	 * 子类需要间接实现的页面请求处理类
	 * 
	 * @param param
	 * @param view
	 * @return
	 */
	public abstract String process(Map<String, Object> param,
			Map<String, Object> view);

}
